<?php
/**
 * Pipahr
 *
 * @author Chin Win
 * @copyright 2013 pipahr.com
 */
require_once(OC_App::getAppPath('calendar') . "/lib/helper.php");
JLoader::register("PCalendarModellistview", OC_App::getAppPath('calendar') . "/lib/listview.php");

OCP\JSON::callCheck();
if(!OC_User::isLoggedIn()) {
   echo '您需要先登录';
   exit;
}

$objectid = JRequest::getInt('objectid', 0);
$jobseekid = JRequest::getInt('jobseekid', 0);
$jobid = JRequest::getInt('jobid', 0);

$model = new PCalendarModellistview();
list($round, $total) = $model->getInterviewRound($jobseekid);

$user = PFactory::getUser();

if ( !empty($round) && !empty($objectid) ) {
   echo'<div class="modal-header">
      <h3>'.$user->name.'</h3>
   </div>
   <div class="modal-body">
      <div class="bs-content">
         <div style="padding:0 8px;">
            <p class="p_title"><b>面试结果通知</b></p>
         </div>
         <div style="padding:15px 25px 0 25px;">
            <p class="p_text">亲爱的 <b style="color:#ff6600;">'.$round[$total-1]['jobseekername'].'</b>，您好！</p>
            <p class="p_text t_intent">非常感谢您来我公司参加 <b>'.$round[$total-1]['job_title'].'</b> 职位面试，您的技能和资历给我们留下了深刻印象。但是经过认真考虑，我们觉得该职位的要求跟您的背景不完全匹配。您的资料已经纳入到我公司人才库，有更适合的新职位时，您会收到申请的邀请。衷心希望您浏览我公司其他职位，并继续关注我公司的发展和招聘需求。</p>
         </div>
         <div class="bs_content_butn">
            <button type="submit" class="ppp_bluebtn btn-sure" id="declinesend">确认发送</button><a href="javascript:;" data-dismiss="modal" aria-hidden="true" style="margin-left:15px;">取消</a>
            <span id="senderror" class="error" style="display:none;">保存失败</span>
         </div>
         <input type="hidden" name="objectid" value="'.$objectid.'" id="objectid">
         <input type="hidden" name="jobid" value="'.$jobid.'" id="jobid">
         <input type="hidden" name="jobseekerid" value="'.$jobseekid.'" id="jobseekerid">
         <input type="hidden" name="jobseekername" value="'.$round[$total-1]['jobseekername'].'" id="jobseekername">
      </div>
   </div>';
   exit();
}
